cmake_minimum_required(VERSION 3.5)

project(core_lib LANGUAGES CXX)

# 搜索 core 目录下的所有源文件和头文件
file(GLOB_RECURSE CORE_SRC
    "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
    "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/*.ui"
    "${PROJECT_SOURCE_DIR}/ui/*.ui"  # 指向根目录下的ui目录中的 .ui 文件
)

# 添加库
add_library(${PROJECT_NAME} STATIC ${CORE_SRC})

target_link_libraries(${PROJECT_NAME} PUBLIC
    Qt5::Core
    Qt5::Gui
    Qt5::Network
    Qt5::Multimedia
    Qt5::Widgets
    Qt5::Qml
    Qt5::Quick
    Qt5::OpenGL
)

find_package(OpenGL REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC OpenGL::GL)

find_package(FFMPEG REQUIRED)
target_include_directories(${PROJECT_NAME} PUBLIC ${FFMPEG_INCLUDE_DIRS})
target_link_directories(${PROJECT_NAME} PUBLIC ${FFMPEG_LIBRARY_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${FFMPEG_LIBRARIES})

